/**
  ******************************************************************************
  * File Name          : g405cmd.c
  * Description        : This file provides code for the configuration
  *                      of the g405 cmd instances.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */

/* Includes ------------------------------------------------------------------*/
#include "bsp.h"
#if(COLLECTOR_USE_TYPE == COLLECTOR_USE_LORA)
#include <stdio.h>
#include "lora.h"

/********************    +++ppp   ******************************/
static const char ppp_cstr[] = "+++";
static const char ppp_rstr[] = "a";
const WHL101_CommandTyp lora_cmd_ppp = 
{
    .cstr    = ppp_cstr,
    .rstr    = ppp_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SIMPLE_INS,
};

/********************    a   ******************************/
static const char a_cstr[] = "a";
static const char a_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_a = 
{
    .cstr    = a_cstr,
    .rstr    = a_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SIMPLE_INS,
};

/********************    E   ******************************/
static const char e_cstr[] = "AT+E=OFF\r\n";
static const char e_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_e = 
{
    .cstr    = e_cstr,
    .rstr    = e_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SIMPLE_INS,
};

/********************    Z   ******************************/
static const char z_cstr[] = "AT+Z\r\n";
static const char z_rstr[] = "+Z:";
const WHL101_CommandTyp lora_cmd_z = 
{
    .cstr    = z_cstr,
    .rstr    = z_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
	  .cmdtype = LORA_SIMPLE_INS,
};

/********************    ENTM   ******************************/
static const char entm_cstr[] = "AT+ENTM\r\n";
static const char entm_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_entm = 
{
    .cstr    = entm_cstr,
    .rstr    = entm_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SIMPLE_INS,
};

/********************    CFGTF   ******************************/
static const char set_cfgtf_cstr[] = "AT+CFGTF\r\n";
static const char set_cfgtf_rstr[] = "+CFGTF:SAVED";
const WHL101_CommandTyp lora_cmd_cfgtf = 
{
    .cstr    = set_cfgtf_cstr,
    .rstr    = set_cfgtf_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SIMPLE_INS,
};

/********************    RELD   ******************************/
static const char set_reld_cstr[] = "AT+RELD=";
static const char set_reld_rstr[] = "REBOOTING";
const WHL101_CommandTyp lora_cmd_reld = 
{
    .cstr    = set_reld_cstr,
    .rstr    = set_reld_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SIMPLE_INS,
};

/********************    WMODE   ******************************/
static const char check_wmode_cstr[] = "AT+WMODE\r\n";
static const char check_wmode_rstr[] = "+WMODE:";
const WHL101_CommandTyp lora_cmd_check_wmode = 
{
    .cstr    = check_wmode_cstr,
    .rstr    = check_wmode_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_wmode_cstr[] = "AT+WMODE=";
static const char set_wmode_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_wmode = 
{
    .cstr    = set_wmode_cstr,
    .rstr    = set_wmode_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

/********************    PMODE   ******************************/
static const char check_pmode_cstr[] = "AT+PMODE\r\n";
static const char check_pmode_rstr[] = "+PMODE:";
const WHL101_CommandTyp lora_cmd_check_pmode = 
{
    .cstr    = check_pmode_cstr,
    .rstr    = check_pmode_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_pmode_cstr[] = "AT+PMODE=";
static const char set_pmode_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_pmode = 
{
    .cstr    = set_pmode_cstr,
    .rstr    = set_pmode_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

/********************    SPD   ******************************/
static const char check_spd_cstr[] = "AT+SPD\r\n";
static const char check_spd_rstr[] = "+SPD:";
const WHL101_CommandTyp lora_cmd_check_spd = 
{
    .cstr    = check_spd_cstr,
    .rstr    = check_spd_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_spd_cstr[] = "AT+SPD=";
static const char set_spd_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_spd = 
{
    .cstr    = set_spd_cstr,
    .rstr    = set_spd_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

/********************    ADDR   ******************************/
static const char check_addr_cstr[] = "AT+ADDR\r\n";
static const char check_addr_rstr[] = "+ADDR:";
const WHL101_CommandTyp lora_cmd_check_addr = 
{
    .cstr   = check_addr_cstr,
    .rstr   = check_addr_rstr,
    .timout = 3000u,
    .rty    = 2,
    .rtytim = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_addr_cstr[] = "AT+ADDR=";
static const char set_addr_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_addr = 
{
    .cstr    = set_addr_cstr,
    .rstr    = set_addr_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

/********************    ch   ******************************/
static const char check_ch_cstr[] = "AT+CH\r\n";
static const char check_ch_rstr[] = "+CH:";
const WHL101_CommandTyp lora_cmd_check_ch = 
{
    .cstr    = check_ch_cstr,
    .rstr    = check_ch_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_ch_cstr[] = "AT+CH=";
static const char set_ch_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_ch = 
{
    .cstr    = set_ch_cstr,
    .rstr    = set_ch_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

/********************    FEC   ******************************/
static const char check_fec_cstr[] = "AT+FEC\r\n";
static const char check_fec_rstr[] = "+FEC:";
const WHL101_CommandTyp lora_cmd_check_fec = 
{
    .cstr    = check_fec_cstr,
    .rstr    = check_fec_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_fec_cstr[] = "AT+FEC=";
static const char set_fec_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_fec = 
{
    .cstr    = set_fec_cstr,
    .rstr    = set_fec_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

/********************    PWR   ******************************/
static const char check_pwr_cstr[] = "AT+PWR\r\n";
static const char check_pwr_rstr[] = "+PWR:"; //5
const WHL101_CommandTyp lora_cmd_check_pwr = 
{
    .cstr    = check_pwr_cstr,
    .rstr    = check_pwr_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_pwr_cstr[] = "AT+PWR="; //5
static const char set_pwr_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_pwr = 
{
    .cstr    = set_pwr_cstr,
    .rstr    = set_pwr_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

/********************    SQT   ******************************/
static const char check_sqt_cstr[] = "AT+SQT\r\n";
static const char check_sqt_rstr[] = "OK"; //5
const WHL101_CommandTyp lora_cmd_sqt = 
{
    .cstr    = check_sqt_cstr,
    .rstr    = check_sqt_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SIMPLE_INS,
};

/********************    SENDOK   ******************************/
static const char check_sendok_cstr[] = "AT+SENDOK\r\n";
static const char check_sendok_rstr[] = "+SENDOK:"; //5
const WHL101_CommandTyp lora_cmd_check_sendok = 
{
    .cstr    = check_sendok_cstr,
    .rstr    = check_sendok_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_CHECK_PARA,
};

static const char set_sendok_cstr[] = "AT+SENDOK="; //5
static const char set_sendok_rstr[] = "OK";
const WHL101_CommandTyp lora_cmd_set_sendok = 
{
    .cstr    = set_sendok_cstr,
    .rstr    = set_sendok_rstr,
    .timout  = 3000u,
    .rty     = 2,
    .rtytim  = 1000u,
		.cmdtype = LORA_SET_PARA,
};

#endif /* #if(COLLECTOR_USE_TYPE == COLLECTOR_USE_LORA) */
